#include<stdio.h>
#include<unistd.h>
#include<stdlib.h>
#include<sys/wait.h>
int main(int argc,char* argv[],char* envp[])
{
  pid_t id=fork();
  if(id==0)
  {
    printf("111");
    printf("process sucess PID:%d,PPID:%d",getpid(),getppid());
    fflush(stdout);
    execve("./practice",argv,envp);
    exit(-1);
  }
  int status=0;
  waitpid(id,&status,0);
  if(WEXITSTATUS(status)!=255)
        printf("子进程替换成功 exit_code:%d\n", WEXITSTATUS(status));
  else
    printf("子进程替换失败 exit_code:%d\n", WEXITSTATUS(status));

  return 0;
}
